﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace WeiTalk.Controls
{
    public partial class WeiBoCommentControl : UserControl
    {
        public WeiBoCommentControl()
        {
            InitializeComponent();
        }

        public static readonly DependencyProperty UserNameProperty =
        DependencyProperty.Register(
        "UserName", typeof(string),
        typeof(WeiBoCommentControl), null
        );
        public string UserName
        {
            get
            {
                return (string)GetValue(UserNameProperty);
            }
            set
            {
                SetValue(UserNameProperty, value);
            }
        }

        public static readonly DependencyProperty CreatedAtProperty =
        DependencyProperty.Register(
        "CreatedAt", typeof(string),
        typeof(WeiBoCommentControl), null
        );
        public string CreatedAt
        {
            get
            {
                return (string)GetValue(CreatedAtProperty);
            }
            set
            {
                SetValue(CreatedAtProperty, value);
            }
        }

        public static readonly DependencyProperty ProfileImageUrlProperty =
        DependencyProperty.Register(
        "ProfileImageUrl", typeof(ImageSource),
        typeof(WeiBoCommentControl), null
        );
        public ImageSource ProfileImageUrl
        {
            get
            {
                return (ImageSource)GetValue(ProfileImageUrlProperty);
            }
            set
            {
                SetValue(ProfileImageUrlProperty, value);
                headImg.Source = value;
            }
        }

        public static readonly DependencyProperty TextProperty =
        DependencyProperty.Register(
        "Text", typeof(string),
        typeof(WeiBoCommentControl), null
        );
        public string Text
        {
            get
            {
                return (string)GetValue(TextProperty);
            }
            set
            {
                SetValue(TextProperty, value);
            }
        }

        public static readonly DependencyProperty SourceProperty =
          DependencyProperty.Register("Source", typeof(string), typeof(WeiBoCommentControl), null);
        public string Source
        {
            get { return (string)GetValue(SourceProperty); }
            set { SetValue(SourceProperty, value); }
        }
		
        public string Id
        { get; set; }

        public string UserId
        { get; set; }

        public string RetweetedId
        {
            get;
            set;
        }

        public string RetweetedUserId
        {
            get;
            set;
        }

        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {
            tbUserName.Text = UserName;
            tbCreateAt.Text = CreatedAt;

            tbSource.Text = Source;

            tbContent.Text = Text;
            this.Visibility = System.Windows.Visibility.Visible;
        }
    }
}
